/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.entities;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author julio
 */
@Entity
@Table(name = "shapes", catalog = "transit", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Shapes.findAll", query = "SELECT s FROM Shapes s"),
    @NamedQuery(name = "Shapes.findByShapeId", query = "SELECT s FROM Shapes s WHERE s.shapesPK.shapeId = :shapeId"),
    @NamedQuery(name = "Shapes.findByShapePtLat", query = "SELECT s FROM Shapes s WHERE s.shapesPK.shapePtLat = :shapePtLat"),
    @NamedQuery(name = "Shapes.findByShapePtLon", query = "SELECT s FROM Shapes s WHERE s.shapesPK.shapePtLon = :shapePtLon"),
    @NamedQuery(name = "Shapes.findByShapePtSequence", query = "SELECT s FROM Shapes s WHERE s.shapesPK.shapePtSequence = :shapePtSequence"),
    @NamedQuery(name = "Shapes.findByShapeDistTraveled", query = "SELECT s FROM Shapes s WHERE s.shapeDistTraveled = :shapeDistTraveled")})
public class Shapes implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ShapesPK shapesPK;
    @Size(max = 45)
    @Column(name = "shape_dist_traveled", length = 45)
    private String shapeDistTraveled;

    public Shapes() {
    }

    public Shapes(ShapesPK shapesPK) {
        this.shapesPK = shapesPK;
    }

    public Shapes(String shapeId, String shapePtLat, String shapePtLon, String shapePtSequence) {
        this.shapesPK = new ShapesPK(shapeId, shapePtLat, shapePtLon, shapePtSequence);
    }

    public ShapesPK getShapesPK() {
        return shapesPK;
    }

    public void setShapesPK(ShapesPK shapesPK) {
        this.shapesPK = shapesPK;
    }

    public String getShapeDistTraveled() {
        return shapeDistTraveled;
    }

    public void setShapeDistTraveled(String shapeDistTraveled) {
        this.shapeDistTraveled = shapeDistTraveled;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (shapesPK != null ? shapesPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Shapes)) {
            return false;
        }
        Shapes other = (Shapes) object;
        if ((this.shapesPK == null && other.shapesPK != null) || (this.shapesPK != null && !this.shapesPK.equals(other.shapesPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.entities.Shapes[ shapesPK=" + shapesPK + " ]";
    }
    
}
